package yesjava;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

public class ScannerDemo2 {
    public static void main(String[] args) throws Exception {
//        Scanner sca = new Scanner(new File("C:\\my_code\\core_java\\day05\\src\\stu.txt"));
        //类路径方式加载资源
        Scanner sca = new Scanner(Thread.currentThread().getContextClassLoader().getResourceAsStream("stu.txt"));
        while (sca.hasNextLine()){
            String line = sca.nextLine();
            if(line != null && line.trim().length()>0){
                String[] stu = line.split(",");
                System.out.println(stu[0]+"/"+stu[1]);
            }
        }
        sca.close();
    }
}
